import java.io.*;
import java.util.ArrayList;
import java.util.Random;

public class java06 {
    public static void main(String[] args) throws Exception{
        BufferedReader fis=new BufferedReader(new FileReader("names.txt"));
        String line;
        ArrayList<String> arr=new ArrayList<>();
        while ((line= fis.readLine())!=null){
            arr.add(line);
        }fis.close();
        Random random=new Random();
        int n= random.nextInt(arr.size());

        BufferedWriter fos=new BufferedWriter(new FileWriter("count.txt", true));
        fos.write("1");fos.newLine();fos.close();
        BufferedReader r=new BufferedReader(new FileReader("count.txt"));
        String len;int count=0;
        while ((len= r.readLine())!=null){
            if(len.equals("1")){
                count++;
            }
        }
        if(count==3){
            BufferedWriter w=new BufferedWriter(new FileWriter("fixedP.txt"));
            w.write(arr.get(n).split("-")[0]);
            w.close();
            System.out.println(arr.get(n).split("-")[0]);
        }else if(count%3==0&&count!=3){
            BufferedReader read=new BufferedReader(new FileReader("fixedP.txt"));
            String l;
            while ((l=read.readLine())!=null){
                System.out.println(l);
            }
        }else {
            System.out.println(arr.get(n).split("-")[0]);
        }
    }
}
